import request from '@/utils/request'

export function fetchList(params) {
  return request({
    url: '/operate/app/yzg',
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: params,
    params: {
      start: params.start,
      length: params.length,
      username: params.username,
      nickname: params.nickname,
      county:params.county,
      pageConvert: params.pageConvert
    }
  })
}
export function fetchLlyList(params) {
  return request({
    url: '/operate/app/lly',
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: params,
    params: {
      start: params.start,
      length: params.length,
      username: params.username,
      nickname: params.nickname,
      county:params.county,
      pageConvert: params.pageConvert
    }
  })
}
export function fetchXzxlList(params) {
  return request({
    url: '/operate/app/xzxl',
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: params,
    params: {
      start: params.start,
      length: params.length,
      username: params.username,
      nickname: params.nickname,
      county:params.county,
      pageConvert: params.pageConvert
    }
  })
}
export function userMananeList(params) {
  return request({
    url: '/ids/users',
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'page-num': params.start,
      'page-size': params.length
    },
    params: params,
    // params: {
    //   start: params.start,
    //   length: params.length,
    //   username: params.username,
    //   nickname: params.nickname,
    //   status: params.type,
    //   deptId: params.deptId,
    //   pageConvert: params.pageConvert
    // }
  })
}

export function createArticle(data) {
  return request({
    url: '/operate/user/save',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}

export function createEmanager(data) {
  return request({
    url: '/operate/app/yzg_save',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}
export function updateArticle(data) {
  return request({
    url: '/operate/user/update',
    method: 'put',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data
  })
}
export function updateEmanager(data) {
  return request({
    url: '/operate/app',
    method: 'put',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data
  })
}
